

package com.soso.base.google.cron;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.soso.base.google.cron.BaseCron;

/**
 * 
 * @author speed
 *
 */
@SuppressWarnings("serial")
public abstract class BaseCronServlet extends HttpServlet  {

	public static final String CRON_URL = "/_ah/cron/scheduling";
	
	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		doGet(request, response);
	}
	
	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		BaseCron baseCron=getBaseCron();
		if(baseCron!=null){
			baseCron.execute();
		}
	}
	public abstract BaseCron getBaseCron();
}
